<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>

    <link
      rel="stylesheet"
      href="../../static/css/login.css"
      type="text/css"
      th:href="@{/static/css/login.css}"
    />
    <link
      rel="stylesheet"
      href="../../static/css/iconfont01.css"
      type="text/css"
      th:href="@{/static/css/iconfont01.css}"
    />
    <link
      rel="stylesheet"
      href="../../static/customAlertConfirm/customAlertConfirm.css"
      th:href="@{/static/customAlertConfirm/customAlertConfirm.css}"
    />
  </head>

  <body>
    <div class="logo">
      <img
        src="../../static/img/logo2.png"
        th:src="@{/static/img/logo2.png}"
        alt=""
      />
    </div>
    <div class="top"></div>
    <div class="login-register">
      <div class="top-content">
        <div class="top-login bar">
          <a th:href="@{/toLogin}" style="color: black">登录</a>
        </div>
        <span>|</span>
        <div class="top-register">
          <a class="toregister" th:href="@{/toRegister}" style="color: black"
            >注册</a
          >
        </div>
      </div>
      <div class="login">
        <form
          th:action="@{/user/login}"
          method="post"
          id="login-form"
          onsubmit="return dosubmit(this)"
          autocomplete="off"
        >
          <div class="login-form">
            <i>*</i>
            <span>邮箱</span>
            <input
              name="login-email"
              type="email"
              placeholder="Email"
              class="loginE"
              th:value="${email}"
            />
            <br />
            <i>*</i>
            <span>密码</span>
            <input
              name="login-password"
              type="password"
              placeholder="Password"
              class="loginPwd"
            />
            <i class="iconfont">&#xe714;</i>
            <br />
            <p class="link-register">
              还没有账号?<a class="link" th:href="@{/toRegister}">立即注册</a>
            </p>
            <input type="submit" class="login-btn" value="登录" />
          </div>
        </form>
        <div class="login-side"></div>
        <div class="login-message">
          <div class="login-img">
            <img
              src="../../static/img/年年有鱼 (1).png"
              th:src="@{/static/img/年年有鱼 (1).png}"
              class="img"
            />
          </div>
        </div>
      </div>
    </div>
    <script
      src="../../static/js/jquery3.7.1.min.js"
      type="text/javascript"
      th:src="@{/static/js/jquery3.7.1.min.js}"
    ></script>
    <script
      type="text/javascript"
      src="../../static/js/login.js"
      th:src="@{/static/js/login.js}"
    ></script>
    <script
      th:src="@{/static/customAlertConfirm/customAlertConfirm.js}"
    ></script>
    <script type="text/javascript" th:inline="javascript">
        let msg=[[${msg}]]
        let t=[[${true}]]
      if(msg!=null&&t){
        showCustomAlert(msg)
      }

        let result=[[${result}]]
        console.log(result)
        if (result){
          if (result.status===-1){
            showCustomAlert(result.message,false)
          }else if(result.status===200){
            showCustomAlert(result.message,true)
          }

        }
    </script>
  </body>
</html>
